package cz.khfotbal.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cz.khfotbal.dao.LinkDao;
import cz.khfotbal.domain.Link;
import cz.khfotbal.service.LinkService;

@Service
public class LinkServiceImpl implements LinkService{

	@Autowired
	private LinkDao linkDao;
	
	public List<Link> getAllLinks() {
		return linkDao.findAllLinks();
	}

	public void createLink(Link newLink) {
		linkDao.saveLink(newLink);
	}

	public void updateLink(Link selectedLink) {
		linkDao.updateLink(selectedLink);
	}

	public void deleteLink(Link selectedLink) {
		linkDao.deleteLink(selectedLink);
	}

	public Link getLinkById(int id) {
		return linkDao.findLinkById(id);
	}

}
